package com.example.demo.entity.primary;

import javax.persistence.*;

/**
 * Created by dongjunpeng on 2017/12/4.
 */
@Entity
@Table(name = "error")
public class ErrorEntity {
    private int errorId;
    private String errorCode;
    private String errorDescription;

    @Id
    @Column(name = "error_id")
    public int getErrorId() {
        return errorId;
    }

    public void setErrorId(int errorId) {
        this.errorId = errorId;
    }

    @Basic
    @Column(name = "error_code")
    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    @Basic
    @Column(name = "error_description")
    public String getErrorDescription() {
        return errorDescription;
    }

    public void setErrorDescription(String errorDescription) {
        this.errorDescription = errorDescription;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ErrorEntity that = (ErrorEntity) o;

        if (errorId != that.errorId) return false;
        if (errorCode != null ? !errorCode.equals(that.errorCode) : that.errorCode != null) return false;
        if (errorDescription != null ? !errorDescription.equals(that.errorDescription) : that.errorDescription != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = errorId;
        result = 31 * result + (errorCode != null ? errorCode.hashCode() : 0);
        result = 31 * result + (errorDescription != null ? errorDescription.hashCode() : 0);
        return result;
    }
}
